home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Demos / AppMaker 2.0b3 / Demo AppMaker 1.5 / Demo AppMaker™ / Demo AppMaker™.rsrc / TmpC_103_Window < prev    next >
Encoding:
Text File  |  1992-04-08  |  3.3 KB  |  181 lines

  1. /* %filename% */
  2. /* Created %date% %time% by AppMaker */
  3.  
  4. #include <Types.h>
  5. #include <Quickdraw.h>
  6. #include <Controls.h>
  7. #include <Dialogs.h>
  8. #include <Events.h>
  9. #include <Lists.h>
  10. #include <Menus.h>
  11. #include <Resources.h>
  12. #include <TextEdit.h>
  13. #include <ToolUtils.h>
  14. #include "ResourceDefs.h"
  15. #include "Globals.h"
  16. #include "Miscellany.h"
  17. #include "Scrolling.h"
  18. #include "WindowAids.h"
  19. #include "%appName%Data.h"
  20. #include "%windname%.h"
  21.  
  22. %for each item gen itemNr%
  23.  
  24. %if lang = MPW%
  25.     #pragma segment %windname% 
  26.  
  27. %end if%
  28. %for each item gen winAuxiliaryProto%
  29.  
  30. %for each item gen winAuxiliary%
  31. /*----------*/
  32. void Open%WindName%%    %(Str255        fName,
  33.                          short        vRefNum,
  34.                          short        fRefNum)
  35. {
  36.     WindowPtr        newWindow;
  37.     Rect            bounds;
  38.  
  39. %if lang = MPW%
  40.     #pragma unused (bounds) 
  41.   
  42. %end if%
  43.     newWindow = GetWindow (%windname%ID);
  44.     if (fName [0] != 0) {
  45.         SetWTitle (newWindow, fName);
  46.     }
  47.     SetPort (newWindow);
  48.     SetNewInfo (newWindow);
  49.     %if has vScroll%
  50.         cur->vScroll = GetNewControl (%cntlID%, newWindow);
  51.      %else%
  52.         cur->vScroll = nil;
  53.     %end if%
  54.     %if has hScroll%
  55.         cur->hScroll = GetNewControl (%cntlID%, newWindow);
  56.      %else%
  57.         cur->hScroll = nil;
  58.     %end if%
  59.     cur->fileNum    = fRefNum;
  60.     cur->volNum        = vRefNum;
  61.     cur->dirty        = false;
  62.     cur->filename    = NewString (fName);
  63.     cur->windowKind = W%WindName%;
  64.     ((WindowPeek) curWindow)->windowKind = userKind + W%WindName%;
  65.     cur->witlHandle = GetResource ('Witl', %WindName%ID);
  66.     cur->wictHandle = GetResource ('Wict', %WindName%ID);
  67.  
  68.     %push firstEdit%
  69.     %for each item gen create%
  70.  
  71.     %if not firstEdit = %
  72.         cur->text = cur->%firstEdit%;
  73.      %else%
  74.         cur->text = nil;
  75.     %end if%
  76.     %pop firstEdit%
  77.  
  78.     %if firstWindow%
  79.         ShowWindow (newWindow);
  80.     %endif%
  81.  
  82. } /*Open%WindName%*/
  83.  
  84. /*----------*/
  85. void Close%WindName%    (void)
  86. {
  87.     %for each item gen dispose%
  88.     
  89.     DisposHandle ((Handle) cur->filename);
  90.     DiscardInfo (curWindow);
  91. } /*Close%WindName%*/
  92.  
  93. /*----------*/
  94. void Control%WindName%  (ControlHandle        whichControl, 
  95.                          short                whichPart, 
  96.                          Point                where)
  97. {
  98.     Rect            bounds;
  99.  
  100. %if lang = MPW%
  101.     #pragma unused (whichControl, whichPart, where, bounds) 
  102.  
  103. %end if%
  104.     %for each item gen track%
  105.  
  106. } /*Control%WindName%*/
  107.  
  108. /*----------*/
  109. void MouseIn%WindName%%    %(Point        where,
  110.                          short        modifiers)
  111. {
  112.     Rect            bounds;
  113.  
  114. %if lang = MPW%
  115.     #pragma unused (where, modifiers, bounds) 
  116.   
  117. %end if%
  118.     %for each item gen mousein%
  119.  
  120. } /*MouseIn%WindName%*/
  121.  
  122. /*----------*/
  123. void TypeIn%WindName%   (char        ch)
  124. {
  125.     if (cur->text == nil) {
  126.         SysBeep (1);
  127.     } else {
  128.         TEKey (ch, cur->text);
  129.         cur->dirty = true;
  130.     }
  131. } /*TypeIn%WindName%*/
  132.  
  133. /*----------*/
  134. void Update%WindName% (void)
  135. {
  136.     Rect            bounds;
  137.  
  138. %if lang = MPW%
  139.     #pragma unused (bounds) 
  140.   
  141. %end if%
  142.     %for each item gen update%
  143.  
  144.     %if has growBox%
  145.         DrawClippedGrow (-15, -15);
  146.     %end if%
  147. } /*Update%WindName%*/
  148.  
  149. /*----------*/
  150. void Activate%WindName%    (Boolean    activate)
  151. {
  152. %if lang = MPW%
  153. #pragma unused (activate) 
  154.   
  155. %end if%
  156.     %for each item gen activate%
  157.  
  158.     %if has growBox%
  159.         DrawClippedGrow (-15, -15);
  160.     %end if%
  161. } /*Activate%WindName%*/
  162.  
  163. /*----------*/
  164. void Resize%WindName%    (void)
  165. {
  166.     /* application-specific code to resize items in window */
  167. } /*Resize%WindName%*/
  168.  
  169. /*----------*/
  170. pascal void Scroll%WindName%%    %(short        newValue,
  171.                                   short        oldValue)
  172. {
  173. %if lang = MPW%
  174. #pragma unused (newValue, oldValue) 
  175.   
  176. %end if%
  177.     /* application-specific code to scroll window */
  178. } /*Scroll%WindName%*/
  179.  
  180. /* %windname% */
  181.